package com.baomibing.flow.exception;

import com.baomibing.tool.exception.ExceptionEnumable;

public enum FlowExceptionEnum implements ExceptionEnumable {

    FLOW_NAME_AND_VERSION_DUPLICATE(30001, "工作流名称版本号不能重复!"),
    NOT_FOUND_THE_ID_OF_FLOW(30002, "未找到ID:{0}对应的工作流!"),
    NOT_FOUND_THE_ID_OF_INSTANCE(30003, "未找到ID:{0}对应的流程实例!"),
    ALL_OR_ALL_ORDER_TASK_NOT_HAVE_CHILD_PROCESS(30004, "会签或顺序会签类型任务没有子流程，请确认任务节点是否配置准确!"),
    PROCESS_HAVE_BEEN_COMPLETE(30005, "流程已完成，无法进行此操作!"),
    NOT_SUPPORT_THE_TYPE_OF_WORK_NODE(30006, "不支持此类型:{0}的工作流节点!"),
    END_NODE_HAVE_MULTI_TRANSITION_NEED_ACTOR(30007, "驳回结束节点可能存在多个路径，请填写对应的执行人!"),
    NOT_FOUND_THE_CORRECT_ACTOR_WHEN_REJECTING(30008, "驳回时未找到正确的执行人，无法进行后续操作!"),
    START_NODE_CAN_NOT_BE_REJECT(30009, "开始节点不能被驳回!"),
    RECOMMIT_TO_LAST_REJECT_POLICY_NOT_FIND_TARGET(30010, "重提到上一次驳回策略，无法找到上一次驳回的节点!"),
    NOT_SUPPORT_THE_RECOMMIT_POLICY(30011, "不支持此类型:{0}的重提策略!"),
    TRANSITION_NODE_CAN_NOT_SUPPORT_TYPE_OF_SOURCE_NODE(30012, "路径节点中不支持此类型:{0}的源节点!"),
    TRANSITION_NODE_CAN_NOT_SUPPORT_TYPE_OF_TARGET_NODE(30013, "路径节点中不支持此类型:{0}的目标节点!"),
    FLOW_HAVE_BEEN_STARTED(30014, "工作流已启动，无法进行此操作!"),
    THERE_IS_NO_EXECUTING_NODE(30015, "没有正在执行的节点，无法完成后续操作!"),
    EXECUTE_PARAMS_EMPTY(30016, "执行参数为空，无法完成后续操作!"),
    CAN_NOT_MATCH_EXECUTING_NODE(30017, "无法匹配正在执行的节点，请确保当前执行的流程节点正确!"),
    CAN_NOT_MATCH_REJECTING_NODE(30018, "无法匹配要驳回的节点，请确保当前驳回的流程节点正确!"),
    EXECUTE_SUB_PROCESS_FAILURE(30019, "执行子流程失败，请确认子流程是否正确!"),
    WORK_NODE_NOT_BE_NULL(30020, "工作流节点不能为空!"),
    ACTION_NOT_BE_NULL(30021, "节点路径不能为空!"),
    NOT_FOUND_THE_SUB_PROCESS_OF_NODE_AND_ACTION(30022, "未找到节点:{0}路径:{1}对应的子流程!"),
    NOT_FOUND_THE_FILL_NODE(30023, "未找到任务申请节点，请确保流程已经开始!"),
    NOT_FOUND_THE_DIRECT_TARGET_NODE(30024, "未找到跳转目标节点，请确认跳转节点是否正确!"),
    NOT_FOUND_THE_NODE_OF_FORK_PROCESS(30025, "未找到流程节点对应的分支流程，无法进行后续操作!"),
    NOT_FOUND_THE_NODE_OF_PARALLEL_PROCESS(30026, "未找到流程节点对应的并行流程，无法进行后续操作!"),
    NOT_FOUND_THE_NODE_OF_JOIN_PROCESS(30027, "未找到流程节点对应的聚合节点，无法进行后续操作!"),
    NOT_SUPPORT_THE_TYPE_OF_PROCESS(30028, "不支持此类型:{0}的流程!"),
    TARGET_PROCESS_OF_JOIN_PROCESS_HAVE_BEEN_COMPLETE(30029, "聚合节点对应的目标流程已结束，请确认目标流程是否正确!"),
    NOT_FOUND_THE_JOIN_PROCESS_OF_SUB_PROCESS_BY_ACTOR(30030, "未找到聚合流程中执行者对应的子流程!"),
    PROCESS_NOT_EXECUTED(30031, "流程未执行, 无法执行此操作!"),
    VARIABLE_MAP_IS_EMPTY(30032, "变量映射为空，无法进行后续操作!"),
    ACTOR_IS_EMPTY(30033, "执行人为空，无法进行后续操作!"),
    ACTOR_NOT_HAVE_PRIVILEGES(30034, "执行者:{0}没有权限，请确认执行者是否正确!"),
    NOT_SUPPORT_THE_TYPE_OF_SOURCE_NODE(30035, "不支持此类型:{0}的源节点!"),
    NOT_SUPPORT_THE_TYPE_OF_TARGET_NODE(30036, "不支持此类型:{0}的目标节点!"),
    PROCESS_NOT_EXECUTED_CAN_NOT_REJECT(30037, "流程未执行，无法驳回!")
    ;


    FlowExceptionEnum(final int code, final String message) {
        this.code = code;
        this.message = message;
    }

    private int code;

    private String message;

    @Override
    public int getExceptionCode() {
        return code;
    }

    @Override
    public String getExceptionMessage() {
        return this.message;
    }
}
